package com.chem.lems.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;


@Data
@NoArgsConstructor                 //无参构造
@AllArgsConstructor                //有参构造
public class ECharts {
    private String value;
    private String name;
    private Iabel label;
}

@Data
@NoArgsConstructor                 //无参构造
@AllArgsConstructor
        //有参构造
class Iabel {
//    private String formatter = "['{title|{b}}{abg|}','{sex|性别}{num|人数}{rateHead|占比}','{hr|}','{Male|男}{value|${male}}{rate|${maleRate}}','{Female|女}{value|${female}}{rate|${femaleRate}}'].join('\n')";
    private String formatter =
        "    {title|{b}}{abg|}\n" +
        "    {sex|性别}{num|人数}{rateHead|占比}\n" +
        "    \n{hr|}\n" +
        "    {Male|男}{value|${male}}{rate|${maleRate}}\n" +
        "    {Female|女}{value|${female}}{rate|${femaleRate}}";
//       + "].join('\n)";
    private String backgroundColor = "#eee";
    private String borderColor = "#777";
    private Integer borderWidth = 1;
    private Integer borderRadius = 4;
    private Rich rich = new Rich();

}

@Data
@NoArgsConstructor                 //无参构造
@AllArgsConstructor
        //有参构造
class Rich {
    private Title title = new Title();
    private Abg abg = new Abg();
    private Sex sex = new Sex();
    private Hr hr = new Hr();
    private Value value = new Value();
    private Num num = new Num();
    private Rate rate = new Rate();
    private RateHead rateHead = new RateHead();
}

@Data
class Title {
    private String color = "#eee";
    private String align = "center";
}

@Data
class Abg {
    private String backgroundColor = "#333";
    private String width = "100%";
    private String align = "right";
    private Integer height = 25;
    private Integer[] borderRadius = {4, 4, 0, 0};
}

@Data
class Sex {
    private String color = "#333";
    private Integer height = 24;
    private String align = "left";
}

@Data
class Hr {
    private String borderColor = "#777";
    private String width = "100%";
    private double borderWidth = 0.5;
    private Integer height = 0;
}

@Data
class Value {
    private Integer width = 20;
    private Integer[] padding = {0, 20, 0, 30};
    private String align = "left";
}

@Data
class Num {
    private String color = "#333";
    private Integer width = 20;
    private Integer[] padding = {0, 20, 0, 30};
    private String align = "center";
}

@Data
class Rate {
    private Integer width = 40;
    private String align = "right";
    private Integer[] padding = {0, 10, 0, 0};
}

@Data
class RateHead {
    private String color = "#333";
    private Integer width = 40;
    private String align = "center";
    private Integer[] padding = {0, 10, 0, 0};
}